﻿using System.Data;
using FX.CC.Andon.Entity.ReportManage;
using FX.CC.Andon.Service.ReportManage;
using FX.CC.Andon.Utility.Common;
using FX.CC.Andon.Utility.Json;

namespace FX.CC.Andon.Business.ReportManage
{
    /// <summary>
    /// 异常情况报表业务层
    /// </summary>
    public class AbnormalReptBusiness
    {
        private readonly AbnormalReptService _dal=new AbnormalReptService();

        public string GetAbnormalReptList(AbnormalQcEntity qcmodel)
        {
            var total = _dal.GetAbnormalReptCount(qcmodel);
            var list = _dal.GetAbnormalReptList(qcmodel);
            return JsonHelper.Encode(total, list);
        }

        public DataTable ExportAbnormalRept(AbnormalQcEntity qcmodel)
        {
            var list = _dal.ExportAbnormalRept(qcmodel);
            return Collection.ListToDataTable(list);
        }

        public string GetAbnormalDetailList(AbnormalQcEntity qcmodel)
        {
            var total = _dal.GetAbnormalDetailCount(qcmodel);
            var list = _dal.GetAbnormalDetailList(qcmodel);
            return JsonHelper.Encode(total, list);
        }

        public string GetSenderDetailList(AbnormalQcEntity qcmodel)
        {
            var total = _dal.GetSenderDetailCount(qcmodel);
            var list = _dal.GetSenderDetailList(qcmodel);
            return JsonHelper.Encode(total, list);
        }
    }
}
